package view;

import javafx.collections.ObservableList;
import javafx.fxml.FXMLLoader;
import javafx.scene.Scene;
import javafx.scene.control.ListView;
import lombok.Data;
import utils.Connect;
import utils.User;

import java.io.IOException;
import java.util.List;
/**
 * @author
 */
@Data
public class NewFriend extends AbstractWindow {
    private List<User> newFriends;
    private static NewFriend newFriend = null;
    public  ObservableList<Object> newFriendList1;
    private ListView<Object> newFriendList;

    public static NewFriend getNewFriend() {
        return newFriend;
    }
    public NewFriend(){
        newFriend=this;
    }

    public void fun() throws IOException {

        Connect connect=Connect.getConnect();

        connect.getNewFriends(MainWindow.getMainWindow().getUser().getAccount());

    }

    @Override
    public void startWindow() throws IOException {
        root = FXMLLoader.load(getClass().getResource("fxml/NewFriendView.fxml"));
        setTitle("AChat-新的好友请求");
        setScene(new Scene(root));
        show();
    }
}
